/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.rpgmapper.character;

import com.jme3.asset.AssetManager;
import com.jme3.scene.Node;
import net.sf.nwn.jme3.ControllableModel;
import net.sf.nwn.jme3.ControllableModelPrototype;
import net.sf.nwn.jme3.ShadingType;

/**
 *
 * @author Nehon
 */
public class NWNCharacterModel implements CharacterModel {

    private ControllableModel model;

    public NWNCharacterModel(AssetManager assetManager, String path) {
        ControllableModelPrototype cmp = new ControllableModelPrototype(assetManager, path, ShadingType.LOW);
        model = cmp.createModel();

        Node modelNode = model.getMainNode();
        modelNode.setLocalScale(0.5f);
//        for (String name : model.getAllAnimationNames()) {
//            System.out.println(name);
//                    
//        }
    }

    public void walk() {
        model.playAnimation("crun", true);
    }

    public void stop() {
        model.playDefaultAnimation();
    }

    public Node getNode() {
        return model.getMainNode();
    }
}
